package com.dashang.util.filter;

import javax.servlet.*;
import java.io.IOException;

/**
 *
 * 编码过滤
 *
 * @author 陈兴
 * @version [版本号, 2011-9-16]
 * @see [相关类/方法]
 * @since [产品/模块版本]
 */
public class CharacterFilter implements Filter
{

    public void destroy()
    {

    }

    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
        throws IOException, ServletException
    {
        request.setCharacterEncoding("UTF-8");
        chain.doFilter(request, response);
    }

    public void init(FilterConfig arg0)
        throws ServletException
    {

    }

}
